<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>欢迎光临 Music Store</title>
<link type="text/css" rel="Stylesheet"
	href="${pageContext.request.contextPath }/style/front.css" />
<script src="../script/jquery-1.10.2.js"></script>
<script>
	
</script>
<style>
#title {
	width: 950px;
	margin: 10px auto;
	height: 40px;
	background-color: white;
}

#title h3 {
	line-height: 40px;
	margin: 0px 30px;
	font-size: 18px;
}

#main {
	width: 930px;
	margin: 0px auto;
}

.table thead {
	font-weight: bold;
}

.table table {
	text-align: center;
	margin: 10px auto;
}

.table td {
	width: 150px;
	background-color: #f4f4f4;
	padding: 2px 0px;
}

.table .sp {
	width: 300px;
}

hr {
	margin: 5px 0px;
}

.search {
	margin: 5px 10px;
}
</style>
</head>

<body>
	<div id="wrapper">
		<s:action name="header" executeResult="true" namespace="/admin"></s:action>
		<div id="content">
			<div id="title">
				<h3>商品管理</h3>
			</div>
			<div id="main">
				<div class="search">
					<form action="goodsBiz" method="post">
						唱片分类：<select name="genreId">
						<option value="0">所有分类</option>
						<c:forEach items="${genreList }" var="g">
							<c:if test="${genreId==g.id }">
								<option value="${g.id }" selected="selected">${g.name }</option>
							</c:if>
							<c:if test="${genreId!=g.id }">
								<option value="${g.id }">${g.name }</option>
							</c:if>
						</c:forEach>
					</select> &nbsp;&nbsp;&nbsp; 唱片名称：<input type="text" name="title" value="${title }"/>&nbsp;&nbsp;&nbsp;
					<input type="submit" value="查询" id="search" />
					</form>
				</div>
				<hr />
				<a href="addAlbum">添加新唱片</a>
				<div class="table">
					<table>
						<thead>
							<tr>
								<td class="sp">唱片名称</td>
								<td>歌手</td>
								<td>单价</td>
								<td>编辑</td>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${albumList }" var="a">
								<tr>
									<td class="sp">${a.title }</td>
									<td>${a.artist }</td>
									<td>${a.price }</td>
									<td><a href="addAlbum?id=${a.id }">编辑</a></td>
								</tr>
							</c:forEach>

							<tr>
								<td colspan="4" style="padding-left: 450px;"><c:if
										test="${pageNum>1 }">
										<a
											href="goodsBiz?pageNum=${pageNum-1 }&title=${title}&genreId=${genreId}">上一页</a>
									</c:if> <c:if test="${pageNum<totalPage }">
									&nbsp;&nbsp;<a
											href="goodsBiz?pageNum=${pageNum+1 }&title=${title}&genreId=${genreId}">下一页</a>
									</c:if> &nbsp;&nbsp;共${totalPage }页，第${pageNum }页。</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="clearBoth"></div>
		</div>
		<%@ include file="../shared/back.jsp"%>
	</div>
</body>
</html>
